package com.baogu.database.service.impl;

import com.baogu.database.mapper.SensorWarningImportMapper;
import com.baogu.database.service.SensorWarningImportService;
import com.baogu.model.database.SensorDataImport;
import com.baogu.model.database.SensorWarningImport;
import com.baogu.model.database.where.SensorWarningImportWhere;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SensorWarningImportServiceImpl implements SensorWarningImportService {

    @Autowired
    SensorWarningImportMapper sensorWarningImportMapper;

    @Override
    public List<SensorWarningImport> allList(SensorWarningImportWhere where) {
        return sensorWarningImportMapper.allList(where);
    }

    @Override
    public SensorWarningImport getImpprtByVersion(String version) {
        SensorWarningImportWhere where = new SensorWarningImportWhere();
        where.setVersion(version);
        return sensorWarningImportMapper.allList(where).get(0);
    }

    @Override
    public Integer updataDataImport(SensorWarningImport sensorWarningImport) {
        return sensorWarningImportMapper.updateByPrimaryKeySelective(sensorWarningImport);
    }
}
